-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce ruff/refurb rules (FURB) #2373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good here. Just need to resolve the conflict.
pyproject.toml
Outdated
"FURB140", # TODO: apply this rule | ||
"PT004", # deprecated | ||
"PT011", # TODO: apply this rule | ||
"PT012", # TODO: apply this rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to do these here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean exactly? Don't you like the TODO
comments, or the disabled rules? I've disabled them because I'm not necessarily happy with the readability of the code after applying FURB118 and FURB140.
Would it be OK to apply the rules, show the result, and let reviewers decide whether to keep the rules or disable them (without a TODO
comment)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious if these TODOs are for this PR are a later one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me apply these rules now, I'm interested in your opinion.
06af42d
to
c1b9760
Compare
FURB110 Replace ternary `if` expression with `or` operator
FURB118 Use `operator.itemgetter(0)` instead of defining a lambda
FURB140 Use `itertools.starmap` instead of the generator
FURB188 Prefer `removesuffix` over conditionally replacing with slice.
c1b9760
to
b0f2829
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good here
TODO: